package com.dongdongshop.data;

/**
 * @Description
 * @ClassName DataResult
 * @Author RC
 * @date 2020.12.10 00:08
 */
public class DataResult<T> {
    private Integer code;

    private String message;

    private T data;

    private T data1;

    public static DataResult response(ResponseStausEnum responseStausEnum){
        return new DataResult(responseStausEnum.getIndex(),responseStausEnum.getName());
    }

    public DataResult() {
        super();
    }

    public DataResult(Integer code) {
        this.code = code;
    }

    public DataResult(Integer code, String message) {
        this.code = code;
        this.message = message;
    }

    public DataResult(Integer code, String message, T data) {
        this.code = code;
        this.message = message;
        this.data = data;
    }

    public DataResult(Integer code, String message, T data, T data1) {
        this.code = code;
        this.message = message;
        this.data = data;
        this.data1 = data1;
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public T getData() {
        return data;
    }

    public DataResult setData(T data) {
        this.data = data;
        return this;
    }

    public T getData1() {
        return data1;
    }

    public void setData1(T data1) {
        this.data1 = data1;
    }

}
